# docker build --build-arg JAVA_HOME=/usr/lib/jvm/java-11 -t nexus-prod.niceloo.com:8083/youlu/ssedemo:1.0 .
# docker run -p 8080:8080 nexus.niceloo.com:8083/youlu/ssedemo:1.0
# docker login nexus-prod.niceloo.com:8083 -u admin -p admin123
# docker push nexus-prod.niceloo.com:8083/youlu/ssedemo:1.0
# nexus.youlu.com:8443/youlu/ssedemo:1.0
FROM nexus.niceloo.com:8083/baseimage/common:3.0.0

ARG JAVA_HOME=/usr/lib/jvm/java-11

COPY --from=nexus.niceloo.com:8083/baseimage/java:3.0.0 ${JAVA_HOME} ${JAVA_HOME}

RUN ln -sf ${JAVA_HOME}/bin/java /usr/bin \
    && ln -sf ${JAVA_HOME}/bin/jmap /usr/bin \
    && ln -sf ${JAVA_HOME}/bin/jstack /usr/bin \
    && ln -sf ${JAVA_HOME}/bin/jstat /usr/bin \
    && echo "IMAGE_DATE=`date +%Y-%m-%d\ %H:%M:%S`" >> /image/image.info

COPY build/libs/server-sent-events-0.0.1-SNAPSHOT.jar /root/app.jar

ENTRYPOINT ["java", "-jar", "/root/app.jar"]
